import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs";
const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/apartment"
const baseUrls = Vue.prototype.$itsoftUI.config.serviceUrl + "/manager"

//院系信息api
const apiBuilding = {
    //获取管理中心校区列表
    //左侧列表
    getDistrictList: function(page, order) {
        const data = { page, order }
        return request({
            url: baseUrls + '/district/list',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //列表
    List: function(search, fields, order, page) {
        const data = {
            search,
            fields,
            order,
            page
        }
        return request({
            url: baseUrl + '/manageBuilding/list',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //提取信息
    Get: function(id) {
        const data = { id }
        return request({
            url: baseUrl + '/manageBuilding/get',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //编辑
    Save: function(data) {
        const config = {
            headers: { 'Content-Type': 'application/json;charset=utf-8' },
        }
        return request.post(baseUrl + '/manageBuilding/save', data, config)
    },
    //删除
    Del: function(ids) {
        const data = { ids }
        return request({
            url: baseUrl + '/manageBuilding/delete',
            method: 'post',
            data: qs.stringify(data)
        })
    },

}
export { apiBuilding }